// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
    const wxContext = cloud.getWXContext()
    const openID=wxContext.OPENID
    const title=event.title
    const time=event.time
    const desc=event.desc
    const hasTime=event.hasTime
    const classify=event.classify
    const done=event.done
    const _id=event._id
    const db=cloud.database()
    db.collection('toDo')
    .where({
        _id:_id,
        _openid:openID
    }).update({
        data:{
            classify:classify,
            description:desc,
            done:done,
            hasTime:hasTime,
            time:time,
            title:title
        },
    })
}